HA$PBExportHeader$u_cst_tab_asignaciones.sru
forward
global type u_cst_tab_asignaciones from u_cst_tabpage
end type
type dw_2 from uo_dw within u_cst_tab_asignaciones
end type
type dw_1 from uo_dw within u_cst_tab_asignaciones
end type
type ddlb_2 from uo_ddlb within u_cst_tab_asignaciones
end type
type pb_2 from picturebutton within u_cst_tab_asignaciones
end type
type sle_1 from singlelineedit within u_cst_tab_asignaciones
end type
type st_1 from statictext within u_cst_tab_asignaciones
end type
type pb_1 from picturebutton within u_cst_tab_asignaciones
end type
type cb_3 from commandbutton within u_cst_tab_asignaciones
end type
type cb_2 from commandbutton within u_cst_tab_asignaciones
end type
type uo_xplistbar from u_cst_xplistbar within u_cst_tab_asignaciones
end type
type sle_buscar from singlelineedit within u_cst_tab_asignaciones
end type
type ddlb_1 from dropdownlistbox within u_cst_tab_asignaciones
end type
type uo_powerdock from u_cst_powerdock within u_cst_tab_asignaciones
end type
type uo_toolbarstrip from u_cst_toolbarstrip within u_cst_tab_asignaciones
end type
type uo_gb_listado from u_cst_groupbox within u_cst_tab_asignaciones
end type
type uo_gb_asig from u_cst_groupbox within u_cst_tab_asignaciones
end type
type uo_gb_borde from u_cst_groupbox within u_cst_tab_asignaciones
end type
end forward

global type u_cst_tab_asignaciones from u_cst_tabpage
integer width = 4366
integer height = 3324
event ue_addtab ( string as_titulo,  string as_icono )
event type integer ue_validar ( )
dw_2 dw_2
dw_1 dw_1
ddlb_2 ddlb_2
pb_2 pb_2
sle_1 sle_1
st_1 st_1
pb_1 pb_1
cb_3 cb_3
cb_2 cb_2
uo_xplistbar uo_xplistbar
sle_buscar sle_buscar
ddlb_1 ddlb_1
uo_powerdock uo_powerdock
uo_toolbarstrip uo_toolbarstrip
uo_gb_listado uo_gb_listado
uo_gb_asig uo_gb_asig
uo_gb_borde uo_gb_borde
end type
global u_cst_tab_asignaciones u_cst_tab_asignaciones

type variables

s_parm  istr_parm
datastore ids_datastore ,ids_sysmenutool
long ii_tabindex,il_index ,ll_tabmanto
integer ii_idmenu
//user secundarios
//u_cst_mle uo_mle


userobject iuo_user[]
userobject iuo_dwgrid

Window iw_parent
string is_tab2, is_idToolBar, is_idmenu,is_entidad,isTabSecu , is_tituloSecu,is_rutaIcoSecu,is_uoDwGrid ,is_uoTitulo,is_uoImg ,is_columna,isa_columna[]
string is_sql,is_tabla,is_dw1,is_dw2,is_tdesc

string is_toolbar

end variables

forward prototypes
public function integer of_getwindow ()
public subroutine of_cargar_columnas (datawindow adw)
end prototypes

event ue_addtab(string as_titulo, string as_icono);//ll_tabmanto ++
//uo_PowerDock.of_OpenDocument   ( iuo_user[ll_tabmanto ] , istr_parm,as_titulo,as_icono,is_tab2)
//uo_PowerDock.of_ActivateDocument(iuo_user[ll_tabmanto])
end event

event type integer ue_validar();long li_verificar

//if event ue_getdwmodified() >0 and ib_sw = true  then
//	li_verificar = event ue_verificar_modified('C') 
//	choose case  li_verificar
//		case 1
//			return 0
//		case 2 
//			return 1
//	end choose
//else
	return 0
//end if
//
end event

public function integer of_getwindow (); PowerObject	lpo_parent
Window lw_window

// loop thru parents until a window is found
lpo_parent = GetParent()
Do While lpo_parent.TypeOf() <> Window! and IsValid(lpo_parent)
	lpo_parent = lpo_parent.GetParent()
Loop

// set return to the window or null if not found
If IsValid (lpo_parent) Then
	lw_window = lpo_parent
Else
	SetNull(lw_window)
End If

iw_parent = lw_window

RETURN 1
end function

public subroutine of_cargar_columnas (datawindow adw);
//s_param_cols ls_struc
//ls_struc = dr
//////ls_struc = Message.PowerObjectParm	
//ddlb_1.additem(ls_struc.col1)
//ddlb_1.additem(ls_struc.col2)
//ddlb_1.additem(ls_struc.col3)
//ddlb_1.additem(ls_struc.col4)
//ddlb_1.additem(ls_struc.col5) 
ddlb_1.reset( )
string ls_syntax, ls_cadena, ls_temp 
long ld_pos, ld_pos_ini, ld_pos_fin
Integer li_fila
ls_syntax = adw.Describe("DataWindow.Syntax")

/* Recupera el nombre de las columnas */
ld_pos = 1
ls_cadena = ''
li_fila =1
Do While ld_pos > 0
	ld_pos = pos(ls_syntax, 'text', ld_pos)
	If ld_pos > 0 Then
		ld_pos_ini = pos(ls_syntax, 'name=', ld_pos)
		ld_pos_fin = pos(ls_syntax, ' ', ld_pos_ini)
		ls_temp = ls_cadena +' '+ mid(ls_syntax, ld_pos_ini+5, ld_pos_fin - ld_pos_ini - 5 )
		If Right(ls_temp, 2)='_t' Then 	
//			li_fila = dw_1.InsertRow(0)
		
//			dw_1.Object.Columna_name[li_fila] = Trim(Left(ls_temp, Len(ls_temp)-2))
			isa_columna[li_fila]= Trim(Left(ls_temp, Len(ls_temp)-2))
//			ddlb_1.additem(Trim(Left(ls_temp, Len(ls_temp)-2)))	

			//-- las etiquetas
			ld_pos_ini = pos(ls_syntax, 'text="', ld_pos_fin)
			ld_pos_fin = pos(ls_syntax, '"', ld_pos_ini+7)
			
//			dw_1.Object.Columna_text[li_fila] = Trim(mid(ls_syntax, ld_pos_ini+6, ld_pos_fin - ld_pos_ini -6))
			ddlb_1.additem(Trim(mid(ls_syntax, ld_pos_ini+6, ld_pos_fin - ld_pos_ini -6)))
			li_fila ++
		End If
			
		ld_pos = ld_pos_fin
	End If
Loop
ddlb_1.selectitem( 1)
ddlb_1.event selectionchanged(1)
Return


end subroutine

on u_cst_tab_asignaciones.create
int iCurrent
call super::create
this.dw_2=create dw_2
this.dw_1=create dw_1
this.ddlb_2=create ddlb_2
this.pb_2=create pb_2
this.sle_1=create sle_1
this.st_1=create st_1
this.pb_1=create pb_1
this.cb_3=create cb_3
this.cb_2=create cb_2
this.uo_xplistbar=create uo_xplistbar
this.sle_buscar=create sle_buscar
this.ddlb_1=create ddlb_1
this.uo_powerdock=create uo_powerdock
this.uo_toolbarstrip=create uo_toolbarstrip
this.uo_gb_listado=create uo_gb_listado
this.uo_gb_asig=create uo_gb_asig
this.uo_gb_borde=create uo_gb_borde
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.dw_2
this.Control[iCurrent+2]=this.dw_1
this.Control[iCurrent+3]=this.ddlb_2
this.Control[iCurrent+4]=this.pb_2
this.Control[iCurrent+5]=this.sle_1
this.Control[iCurrent+6]=this.st_1
this.Control[iCurrent+7]=this.pb_1
this.Control[iCurrent+8]=this.cb_3
this.Control[iCurrent+9]=this.cb_2
this.Control[iCurrent+10]=this.uo_xplistbar
this.Control[iCurrent+11]=this.sle_buscar
this.Control[iCurrent+12]=this.ddlb_1
this.Control[iCurrent+13]=this.uo_powerdock
this.Control[iCurrent+14]=this.uo_toolbarstrip
this.Control[iCurrent+15]=this.uo_gb_listado
this.Control[iCurrent+16]=this.uo_gb_asig
this.Control[iCurrent+17]=this.uo_gb_borde
end on

on u_cst_tab_asignaciones.destroy
call super::destroy
destroy(this.dw_2)
destroy(this.dw_1)
destroy(this.ddlb_2)
destroy(this.pb_2)
destroy(this.sle_1)
destroy(this.st_1)
destroy(this.pb_1)
destroy(this.cb_3)
destroy(this.cb_2)
destroy(this.uo_xplistbar)
destroy(this.sle_buscar)
destroy(this.ddlb_1)
destroy(this.uo_powerdock)
destroy(this.uo_toolbarstrip)
destroy(this.uo_gb_listado)
destroy(this.uo_gb_asig)
destroy(this.uo_gb_borde)
end on

event resize;call super::resize;//uo_treeview.Height = this.Height

DW_1.Height = this.Height -500
DW_2.Height = this.Height -500
uo_gb_listado.height = this.height

uo_gb_borde.width = this.width -20
uo_gb_borde.Height = this.Height  - 50
//DW_1.Height = this.Width / 2

//
//if st_border.visible= false then
//uo_PowerDock.Resize( this.width, this.height - (uo_toolbarstrip.height  ))
//	uo_PowerDock.Move(4, st_border.height )
//else
	uo_PowerDock.Resize( this.width, this.height - (uo_toolbarstrip.height + 12))
//   uo_PowerDock.Move(4,uo_toolbarstrip.height + 12 + st_border.Height)
//end if


uo_toolbarstrip.Width =(this.width - 12) 


//st_border.Width =(this.width - 12) 

end event

event ue_postconstructor;call super::ue_postconstructor;long ll_image
//ii_tabindex = uo_PowerDock.ofof_gettabcount( ) + 1 
//il_tabmanto ++

//uo_PowerDock.of_SetDock(uo_PowerDock.LEFT, TRUE)
//uo_PowerDock.of_SetDock(uo_PowerDock.RIGHT, TRUE)
//uo_PowerDock.of_SetDockSize(uo_PowerDock.LEFT, 1500)
//uo_PowerDock.of_SetDockSize(uo_PowerDock.RIGHT, 1500)
//uo_PowerDock.of_SetDockSize(uo_PowerDock.TOP, 500)
//uo_PowerDock.of_SetDockSize(uo_PowerDock.BOTTOM, 500)
//
//ll_image = uo_PowerDock.of_AddImage(is_rutaIcoSecu)//C:\PBGUIControls105\globe.ico
//uo_PowerDock.of_opentab(iuo_user[ii_tabindex ],istr_parm,is_tituloSecu  ,isTabSecu,ll_image)

//AGREGAR USEROBJECT DATAWINDOWS PARA REALIZAR MANTENIMIENTO DE TABLAS MAESTRAS
//istr_parm.auo_toolbarstrip = uo_toolbarstrip
//istr_parm.auo_toolcabemain = this

//uo_PowerDock.of_AddDockItem(uo_PowerDock.LEFT, uo_gridmain, "Listado ", 'EditDataGrid!')
//uo_PowerDock.of_AddDockItem(uo_PowerDock.LEFT, uo_gridmain,'',istr_parm, "Listado ", 'EditDataGrid!')
//uo_PowerDock.of_AddDockItem(uo_PowerDock.LEFT, iuo_dwgrid,'u_cst_grillamain',istr_parm, "Listado ", 'EditDataGrid!')

//uo_PowerDock.of_AddDockItem(uo_PowerDock.LEFT, iuo_dwgrid , is_uoDwGrid, istr_parm, is_uoTitulo , is_uoImg)

//uo_PowerDock.of_OpenDocument(iw_windowtest2, 'Window','Window!')
//uo_PowerDock.of_OpenDocument( uo_w, istr_parm,'Nuevo User','new!','n_prueba')
//uo_PowerDock.of_OpenDocument( uo_w,  'Window','Window!')

//uo_PowerDock.of_AddDockItem(uo_PowerDock.RIGHT, uo_xplistbar , is_uoDwGrid, istr_parm, is_uoTitulo , is_uoImg)
//Long ll_parent
//
//ll_parent = uo_xplistbar.of_AddGroup('General', 'Mail.ico', uo_xplistbar.SPECIAL)
//uo_xplistbar.of_AddLink('Display Image in Header', 'Custom001!', ll_parent)
//uo_xplistbar.of_AddLink('Hide Image in Header', 'Custom002!', ll_parent)
//uo_xplistbar.of_AddLink('Display Text Shadow', 'Custom003!', ll_parent)
//uo_xplistbar.of_AddLink('Hide Text Shadow', 'Custom004!', ll_parent)
//uo_xplistbar.of_AddLink('Display Close Button', 'Custom029!', ll_parent)
//uo_xplistbar.of_AddLink('Hide Close Button', 'Custom030!', ll_parent)
//uo_xplistbar.of_AddLine(ll_parent)
//uo_xplistbar.of_AddLink('Enable Calendar', 'Custom027!', ll_parent)
//uo_xplistbar.of_AddLink('Disable Calendar', 'Custom028!', ll_parent)

//if isnull(isTabSecu) or len(isTabSecu) = 0 then return

//uo_PowerDock.of_OpenDocument( iuo_user[ii_tabindex ], istr_parm,is_tituloSecu,is_rutaIcoSecu,isTabSecu)

//uo_PowerDock.of_OpenDocument(uo_dw4, 'ITEM RELACIONADOS','Window!')
end event

event constructor;call super::constructor;
of_getwindow()

istr_parm = message.powerobjectparm 

ids_datastore =  istr_parm.ads_menu 
is_idmenu      = ids_datastore.object.Idmenu[1]
is_idToolBar   =  ids_datastore.object.idToolBar[1]
is_tab2   =  ids_datastore.object.tTab2[1]
is_sql = ids_datastore.object.tsql[1]
is_tabla = ids_datastore.object.ttabla[1]
is_dw1 = ids_datastore.object.tdw1[1]
is_dw2= ids_datastore.object.tdw2[1]
is_tdesc =ids_datastore.object.tDesc[1]


ii_tabindex ++

if is_sql = '' or isnull(is_sql) then is_sql = ''
dw_1.dataobject =is_dw1
dw_2.dataobject =is_dw2
dw_2.settransobject(sqlca)
dw_1.settransobject( sqlca)

uo_gb_borde.of_Text('Asignaciones: ' + is_tdesc)
uo_gb_borde.of_SetImage('GroupBox!')
uo_gb_borde.of_SetTheme(uo_gb_borde.BLUE)
uo_gb_borde.of_SetStyle(uo_gb_borde.HEADER)
uo_gb_borde.of_ActivateTheme(uo_gb_borde.BLUE)
uo_gb_borde.of_VGradient(TRUE)

uo_gb_listado.of_Text('LISTADOS')
uo_gb_listado.of_SetImage('GroupBox!')
uo_gb_listado.of_SetTheme(uo_gb_listado.BLUE)
//uo_gb_listado.of_SetStyle(uo_gb_listado.HEADER)
uo_gb_listado.of_ActivateTheme(uo_gb_listado.BLUE)
uo_gb_listado.of_VGradient(TRUE)


uo_gb_asig.of_Text('ASIGNACIONES')
uo_gb_asig.of_SetImage('GroupBox!')
uo_gb_asig.of_SetTheme(uo_gb_asig.BLUE)
//uo_gb_asig.of_SetStyle(uo_gb_asig.HEADER)
uo_gb_asig.of_ActivateTheme(uo_gb_asig.BLUE)
uo_gb_asig.of_VGradient(TRUE)



//dw_1.retrieve('');commit;
dw_2.retrieve();commit;

//
end event

type dw_2 from uo_dw within u_cst_tab_asignaciones
integer x = 2304
integer y = 444
integer width = 1531
integer height = 1712
integer taborder = 60
string dataobject = "d_mbutton_grid"
boolean hscrollbar = true
boolean vscrollbar = true
end type

type dw_1 from uo_dw within u_cst_tab_asignaciones
integer x = 114
integer y = 424
integer width = 1632
integer height = 1800
integer taborder = 20
string dataobject = "d_mtoolbar_mbutton_id"
boolean hscrollbar = true
boolean vscrollbar = true
end type

type ddlb_2 from uo_ddlb within u_cst_tab_asignaciones
integer x = 498
integer y = 248
integer width = 1243
integer taborder = 70
integer textsize = -8
boolean vscrollbar = true
end type

event constructor;call super::constructor;event ue_cargar( is_sql)
end event

event selectionchanged;call super::selectionchanged;if index<=0 then return

if dw_1.rowcount()>0 then
	if  MessageBox("Sistema", "Desea cancelar los cambios", Question!, OKCancel!, 1) = 2 then return
end if

is_toolbar = gs_col1_uo_ddlb[index]

dw_1.retrieve(is_toolbar)
commit;


end event

type pb_2 from picturebutton within u_cst_tab_asignaciones
integer x = 2450
integer y = 332
integer width = 142
integer height = 96
integer taborder = 50
integer textsize = -10
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
boolean flatstyle = true
string picturename = "BrowseClasses!"
alignment htextalign = right!
end type

type sle_1 from singlelineedit within u_cst_tab_asignaciones
integer x = 2619
integer y = 324
integer width = 1216
integer height = 100
integer taborder = 40
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
borderstyle borderstyle = stylelowered!
end type

type st_1 from statictext within u_cst_tab_asignaciones
integer x = 101
integer y = 252
integer width = 384
integer height = 88
integer textsize = -10
integer weight = 700
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
string text = "Seleccionar:"
alignment alignment = right!
boolean focusrectangle = false
end type

type pb_1 from picturebutton within u_cst_tab_asignaciones
integer x = 1774
integer y = 244
integer width = 101
integer height = 88
integer taborder = 60
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
boolean flatstyle = true
boolean originalsize = true
string picturename = "StartPipeline!"
alignment htextalign = left!
end type

type cb_3 from commandbutton within u_cst_tab_asignaciones
integer x = 1856
integer y = 884
integer width = 393
integer height = 112
integer taborder = 60
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = " >"
end type

event clicked;Long ll_count
integer li_find_dw1,li_fila,li_find
string ls_button[],ls_boton
// Get each of the selected
ls_button = dw_1.Object.idbutton.Current.Selected
// Find the number of selected items by finding the size of the array
ll_count = upperBound(ls_button)

for li_fila = 1 to ll_count
		
	ls_boton = ls_button[li_fila]
	li_find = dw_1.find('idbutton = "'+ls_boton+'"',1,dw_2.rowcount())
//	
//	li_find_dw1 = dw_1.find('idbutton = "'+ls_boton+'"',1,dw_1.rowcount())
//	if li_find_dw1 <> 0  then
//		continue
//	end if
	
	dw_1.deleterow(li_find)
//	dw_1.scrolltorow(dw_1.insertrow(0))
//	dw_1.object.idtoolbar[dw_1.rowcount()] =is_toolbar
//	dw_1.object.idbutton[dw_1.rowcount()] =ls_boton

next
end event

type cb_2 from commandbutton within u_cst_tab_asignaciones
integer x = 1856
integer y = 736
integer width = 393
integer height = 112
integer taborder = 50
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "< "
end type

event clicked;Long ll_count
integer li_find_dw1,li_fila,li_find
string ls_button[],ls_boton
// Get each of the selected
ls_button = dw_2.Object.idbutton.Current.Selected
// Find the number of selected items by finding the size of the array
ll_count = upperBound(ls_button)

for li_fila = 1 to ll_count
		
	ls_boton = ls_button[li_fila]
	li_find = dw_2.find('idbutton = "'+ls_boton+'"',1,dw_2.rowcount())
	
	li_find_dw1 = dw_1.find('idbutton = "'+ls_boton+'"',1,dw_1.rowcount())
	if li_find_dw1 <> 0  then
		continue
	end if
	
	//dw_2.deleterow(li_find)
	dw_1.scrolltorow(dw_1.insertrow(0))
	dw_1.object.idtoolbar[dw_1.rowcount()] =is_toolbar
	dw_1.object.idbutton[dw_1.rowcount()] =ls_boton

next

//f_msj('hola'+ string(ll_count),4)


end event

type uo_xplistbar from u_cst_xplistbar within u_cst_tab_asignaciones
boolean visible = false
integer x = 1719
integer y = 500
integer taborder = 40
end type

on uo_xplistbar.destroy
call u_cst_xplistbar::destroy
end on

type sle_buscar from singlelineedit within u_cst_tab_asignaciones
event enchange pbm_enchange
boolean visible = false
integer x = 9
integer y = 4
integer width = 471
integer height = 92
integer taborder = 40
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
end type

event enchange;string ls
iuo_dwgrid.Dynamic of_filtrar(this.text,is_columna)
//THIS.Text,is_columna

//uo_toolbar.DYNAMIC post event ue_cargar_columnas(dw_1)

end event

type ddlb_1 from dropdownlistbox within u_cst_tab_asignaciones
boolean visible = false
integer x = 562
integer y = 4
integer width = 590
integer height = 400
integer taborder = 20
integer textsize = -8
integer weight = 400
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
long textcolor = 33554432
boolean sorted = false
boolean vscrollbar = true
string item[] = {"ENERO","FEBRERO"}
borderstyle borderstyle = stylelowered!
end type

event selectionchanged;is_columna = isa_columna[index] //this.text(index)

sle_buscar.text=''
sle_buscar.setfocus( )

end event

type uo_powerdock from u_cst_powerdock within u_cst_tab_asignaciones
boolean visible = false
integer x = 1883
integer y = 156
integer width = 411
integer height = 136
integer taborder = 40
end type

on uo_powerdock.destroy
call u_cst_powerdock::destroy
end on

event documentselectionchanged;call super::documentselectionchanged;//f_msg('',string (document ),1)
end event

type uo_toolbarstrip from u_cst_toolbarstrip within u_cst_tab_asignaciones
event ue_cargar_columnas ( datawindow adw )
integer width = 4347
integer taborder = 20
boolean border = true
end type

event ue_cargar_columnas(datawindow adw);
//s_param_cols ls_struc
//ls_struc = dr
//////ls_struc = Message.PowerObjectParm
//ddlb_1.additem(ls_struc.col1)
//ddlb_1.additem(ls_struc.col2)
//ddlb_1.additem(ls_struc.col3)
//ddlb_1.additem(ls_struc.col4)
//ddlb_1.additem(ls_struc.col5)
ddlb_1.reset( )
string ls_syntax, ls_cadena, ls_temp
long ld_pos, ld_pos_ini, ld_pos_fin
Integer li_fila
ls_syntax = adw.Describe("DataWindow.Syntax")

/* Recupera el nombre de las columnas */
ld_pos = 1
ls_cadena = ''
li_fila =1
Do While ld_pos > 0
	ld_pos = pos(ls_syntax, 'text', ld_pos)
	If ld_pos > 0 Then
		ld_pos_ini = pos(ls_syntax, 'name=', ld_pos)
		ld_pos_fin = pos(ls_syntax, ' ', ld_pos_ini)
		ls_temp = ls_cadena +' '+ mid(ls_syntax, ld_pos_ini+5, ld_pos_fin - ld_pos_ini - 5 )
		If Right(ls_temp, 2)='_t' Then 	
//			li_fila = dw_1.InsertRow(0)
		
//			dw_1.Object.Columna_name[li_fila] = Trim(Left(ls_temp, Len(ls_temp)-2))
			isa_columna[li_fila]= Trim(Left(ls_temp, Len(ls_temp)-2))
//			ddlb_1.additem(Trim(Left(ls_temp, Len(ls_temp)-2)))	

			//-- las etiquetas
			ld_pos_ini = pos(ls_syntax, 'text="', ld_pos_fin)
			ld_pos_fin = pos(ls_syntax, '"', ld_pos_ini+7)
			
//			dw_1.Object.Columna_text[li_fila] = Trim(mid(ls_syntax, ld_pos_ini+6, ld_pos_fin - ld_pos_ini -6))
			ddlb_1.additem(Trim(mid(ls_syntax, ld_pos_ini+6, ld_pos_fin - ld_pos_ini -6)))
			li_fila ++
		End If
			
		ld_pos = ld_pos_fin
	End If
Loop
ddlb_1.selectitem( 1)
ddlb_1.event selectionchanged(1)
Return


end event

on uo_toolbarstrip.destroy
call u_cst_toolbarstrip::destroy
end on

event constructor;call super::constructor;string ls_dtool,ls_rutaicono,ls_tiptext,ls_tipobject
integer li_fila,li_visible,li_enabled

ids_sysmenutool = Create DataStore
ids_sysmenutool.DataObject = "d_macceso_menu_button"
ids_sysmenutool.settransobject( sqlca)
ids_sysmenutool.retrieve( is_idToolBar,gs_iduser,is_idmenu)


if ids_sysmenutool.rowcount() > 0 then
	for li_fila = 1 to  ids_sysmenutool.rowcount() 
		ls_tipobject=	 ids_sysmenutool.object.tTipo [li_fila]
		ls_dtool = ids_sysmenutool.object.tDesc[li_fila]
		li_visible  =1// ids_sysmenutool.object.bvisible[li_fila]
		li_enabled  =1// ids_sysmenutool.object.benabled[li_fila]
		ls_rutaicono =''
		ls_rutaicono=  ids_sysmenutool.object.timg[li_fila]
		ls_tiptext = ids_sysmenutool.object.tTipText[li_fila]
		
		if li_visible =1 then
			if ls_tipobject = 'S' then //esto es si va a poner un separador
				  this.of_AddSeparator() ; continue
			end if
			if ls_tipobject = 'D' then 
				if li_enabled = 1 then
					ddlb_1.enabled=true
				else
					ddlb_1.enabled=false
				end if
				ddlb_1.visible = true
				this.of_AddObject(ls_dtool, ddlb_1) ;
				continue
			end if
			
//			if ls_tipobject = 'T' then 
//					if li_enabled = 1 then
//						sle_buscar.visible=true
//						sle_buscar.enabled=true
//					else
//						sle_buscar.visible=false
//						sle_buscar.enabled=false
//					end if
//				sle_buscar.enabled=true
//				this.of_AddObject(ls_dtool, sle_buscar) 
//				continue
//			end if
						
			if ls_tiptext = '' or isnull(ls_tiptext) then ls_tiptext = ls_dtool
			this.of_AddItem(ls_dtool,ls_rutaicono, ls_tiptext)
			if li_enabled=1 then
				this.of_SetEnabled(ls_dtool,true)
			else
				this.of_SetEnabled(ls_dtool,false)
			end if
		end if
	next
end if
this.of_DisplayText(true)
//string ls_dtool,ls_rutaicono,ls_tiptext,ls_tipobject
//integer li_fila,li_visible,li_enabled
//
//ids_sysmenutool = Create DataStore
//ids_sysmenutool.DataObject = "d_accmusermtoolbarbutton"
//ids_sysmenutool.settransobject( sqlca)
//ids_sysmenutool.retrieve( gs_usucodi,is_idToolBar)
//
//if ids_sysmenutool.rowcount() > 0 then
//	for li_fila = 1 to  ids_sysmenutool.rowcount() 
//		ls_tipobject=	 ids_sysmenutool.object.tTipo [li_fila]
//		ls_dtool = ids_sysmenutool.object.tDesc[li_fila]
//		li_visible  = ids_sysmenutool.object.bvisible[li_fila]
//		li_enabled  = ids_sysmenutool.object.benabled[li_fila]
//		ls_rutaicono=  ids_sysmenutool.object.timg[li_fila]
//		ls_tiptext = ids_sysmenutool.object.tTipText[li_fila]
//		
//		if li_visible =1 then
//			if ls_tipobject = 'S' then //esto es si va a poner un separador
//				  this.of_AddSeparator() ; continue
//			end if
//			if ls_tipobject = 'D' then 
//				if li_enabled = 1 then
//					ddlb_1.enabled=true
//					
//				else
//					ddlb_1.enabled=false
//				
//				end if
//				ddlb_1.visible = true
//			
//				this.of_AddObject(ls_dtool, ddlb_1) ;
//		
//				continue
//			end if
//			
//			if ls_tipobject = 'T' then 
//					if li_enabled = 1 then
//						sle_buscar.enabled=true
//					else
//						sle_buscar.enabled=false
//					end if
//				sle_buscar.enabled=true
//				this.of_AddObject(ls_dtool, sle_buscar) 
//				continue
//			end if
//						
//			if ls_tiptext = '' or isnull(ls_tiptext) then ls_tiptext = ls_dtool
//			this.of_AddItem(ls_dtool,ls_rutaicono, ls_tiptext)
//			if li_enabled=1 then
//				this.of_SetEnabled(ls_dtool,true)
//			else
//				this.of_SetEnabled(ls_dtool,false)
//			end if
//		end if
//	next
//end if
////THIS.of_SetSize(THIS.S)
//this.of_DisplayText(true)
//this.of_AddItem('First Row', 'VCRFirst!')
//this.of_AddItem('Prior Row', 'VCRPrior!')
////this.of_AddObject('', em_1)
//this.of_AddItem('Next Row', 'VCRNext!')
//this.of_AddItem('Last Row', 'VCRLa

end event

event ue_buttonclicked;call super::ue_buttonclicked;String ls_file,ls_titulo,ls_userobject,ls_rutaMain
Int li_return , al_index 
long ll_data,ll_count,ll_index,ll_item,ll_report,ll_Rows,ll_RowsDeleted
SetNull(ls_file)

//userobject luo_user[ ]



//il_menu =   istr_parm.ll_menu
//il_index  =  uo_1.of_getselectedtab( )
il_index  =uo_PowerDock.of_getdocumentcount( )
istr_parm.as_button = as_button
istr_parm.as_parm[1] =''
//iuo_user[il_index ]= 	uo_1.ist_tabs[il_index ].ado_object
//ist_tabs.ado_object[il_index]
//ii_tabindex2=  uo_1.of_getselectedtab( )
//f_msj('','index' + string( il_index ),4  )
CHOOSE CASE Upper(as_button)
//		CASE 'SIGUIENTE'
//			iuo_dwgrid.DYNAMIC of_siguiente()
//		CASE 'ANTERIOR'	
//			iuo_dwgrid.DYNAMIC of_anterior() 
//		CASE 'PRIMERO'	
//			iuo_dwgrid.DYNAMIC of_primero() 
//		CASE 'ULTIMO'	
//			iuo_dwgrid.DYNAMIC of_ultimo() 
//		
//		
//		
		CASE 'GRABAR'
			 DW_1.UPDATE()
			 COMMIT;
			 f_msj('Guardado satisfactoriamente',4)
		CASE 'CANCELAR'
			dw_1.accepttext( )
			ll_Rows = dw_1.ModifiedCount()
			ll_RowsDeleted = dw_1.DeletedCount( )
			if ll_Rows > 0  or ll_RowsDeleted > 0  then
				IF 	 f_msj('$$HEX2$$bf002000$$ENDHEX$$Esta seguro que desea cancelar',2) = 2 THEN RETURN
				DW_1.RETRIEVE(IS_TOOLBAR)	
				COMMIT;
			end if
		CASE 'CONSULTAR'
			
			istr_parm.as_parm[1]= iuo_dwgrid.DYNAMIC of_getid()
			istr_parm.auo_powerdock = uo_powerdock 
			IF il_index  = 0 Then
				event ue_addtab('Consultar ' + is_entidad,'SetDefaultClass!')
			Else
				istr_parm.auo_userobject=iuo_user[ll_tabmanto ]
				iuo_user[ll_tabmanto ].EVENT DYNAMIC ue_mostrar(istr_parm,false)
			End If		
////	case 'GENERAR'	
////		if il_index >  0 then ll_report  =   il_report [il_index]
////		iuo_user[il_index ].DYNAMIC of_generar(ll_report )	
////	case 'PARAMETROS'
//////		if il_index  = 0   then
//////			parent.event ue_postconstructor( )
//////		else
////			istruc_param_report.ll_menu  = il_menu
////			istruc_param_report.uo_control  = uo_1
//////			istruc_param_report.uo_report  = parent
////			//OpenWithParm(w_paramreport,istruc_param_report )
////
//////			iuo_user[il_index ].DYNAMIC of_parametro ( il_menu,uo_1,parent )	
//////		end if
////	case 'ORDENAR'
////		iuo_user[il_index ].DYNAMIC of_ordenar()	
////	case 'PREVIEW'
////		ib_preview = NOT ib_preview
////		IF ib_preview THEN
////			iuo_user[il_index ].EVENT DYNAMIC ue_preview(1)
////		ELSE
////		     iuo_user[il_index ].EVENT DYNAMIC ue_preview(2 )
////		END IF
////	case 'IMPRIMIR'
////	   	iuo_user[il_index ].triggerevent( 'ue_imprimir' )
////	case 'SIGUIENTE'
////		iuo_user[il_index ].triggerevent( 'ue_siguiente' )
////	case 'ANTERIOR'
////		iuo_user[il_index ].triggerevent( 'ue_anterior' )		
////	case 'PRIMERO'
////		iuo_user[il_index ].triggerevent( 'ue_primero' )
////	case 'ULTIMO'
////		iuo_user[il_index ].triggerevent( 'ue_ultimo' )	
////	case 'ZOOM-OUT'
////		iuo_user[il_index ].triggerevent( 'ue_zoommenos' )
////
////	case 'ZOOM-IN'
////		iuo_user[il_index ].triggerevent( 'ue_zoommas')
//	case 'CERRAR'
//		uo_PowerDock.of_closedocument( uo_PowerDock.of_getactiveobject( ))
////	case 'BUSCAR'	
//////		tab_1.tabpage_1.uo_1.of_Find()
////		iuo_user[il_index ].DYNAMIC of_Find()
//////		iuo_user.DYNAMIC of_cargar_columnas()
////	case 'CANCELAR'
////		li_return =	iuo_user[il_index ].EVENT DYNAMIC ue_cancelar()
////		if li_return = -1 then return 
////		iou_powerdock.of_closedocument( iou_powerdock.of_getactiveobject( ))
////	CASE 'REFRESCAR'
//////		iuo_userObject
//////		if il_index = 0  then return
////		iuo_user[il_index].triggerevent( 'ue_refrescar')
//	CASE 'GRABAR'
//	//	li_return =	iuo_user[il_index ].EVENT DYNAMIC ue_grabar()
////		if li_return = -1 then return 
//		//uo_powerdock.of_closedocument( uo_powerdock.of_getactiveobject( ))
//
////	CASE 'BORRAR'
////		li_return =	iuo_user[il_index ].EVENT DYNAMIC ue_borrar()
////		if li_return = -1 then return 
//////		iuo_user.triggerevent( 'ue_borrar')
//////		ll_data =iuo_user.EVENT DYNAMIC ue_borrar()
//////		if li_return = -1 then return 
//////	    	iuo_user.triggerevent( 'ue_refrescar')
//	
//	CASE 'CONSULTA'
//		ll_data = iuo_dwgrid.DYNAMIC of_getid()
////		istr_parm.l_param[1]=ll_data
////		istr_parm.s_param[1]='E'
//		istr_parm.auo_powerdock=uo_powerdock
//		IF il_index  = 0 Then
//			ll_tabmanto= 1
//			uo_PowerDock.of_OpenDocument( iuo_user[ll_tabmanto ] , istr_parm,'Consulta User','EditObject!',isTabSecu)
//		else
//			iuo_user[il_index ].EVENT DYNAMIC ue_consultar(ll_data)
//		End If
//
		
//		ii_tabindex++
//		ids_store   = create datastore
//		gnv_menu  = create nvo_menu	
//		gnv_menu.of_getUserObject(ids_store,il_menu)
////		messagebox('',string(il_menu))
//		ls_userobject = ids_store.object.cTabMain[1]
//		ls_rutaMain = ids_store.object.cRutaIcoMain[1] 
//		ls_titulo ='Manto ' + ids_store.object.cTituloMain[1]
//	  
//		gstruc_param.as_rutaicosecu=ids_store.object.cRutaIcoSecu[1]
//		gstruc_param.as_tituloSecu='Editar ' //ids_store.object.cTituloSecu[1]
//		gstruc_param.as_dw=ids_store.object.CTabSecuDw[1]  //'d_sysmenu'	
//		gstruc_param.as_dw2=ids_store.object.CTabSecuDw2[1]
//		gstruc_param.as_dw3=ids_store.object.CTabSecuDw3[1]
//		gstruc_param.as_tipomantodw=ids_store.object.CTipomantoDw[1]
//		if ids_store.object.CTipomantoDw[1] = '2' then
//		    gstruc_param.as_tabsecu=ids_store.object.cTabSecuManto2[1]
//		else
//			gstruc_param.as_tabsecu=ids_store.object.cTabSecuManto[1]
//		end if
//		
//		gstruc_param.as_tiptab='M'
//		gstruc_param.as_opc='2' //editar
//		gstruc_param.ll_codigo=ll_data
////		gstruc_param.ado_powerdock=uo_PowerDock
//	      gstruc_param.ll_menu = 	il_menu 
//		iou_powerdock.of_opendocument( iuo_userObject[ii_tabindex],gstruc_param,ls_titulo ,ls_rutaMain,ls_userobject)
//		iou_powerdock.of_ActivateDocument(iuo_userObject[ii_tabindex])
//	CASE 'REPORTES'
//		ii_tabindex++
//		ids_store   = create datastore
//		gnv_menu  = create nvo_menu	
//		gnv_menu.of_getUserObject(ids_store,il_menu)
////		messagebox('',string(il_menu))
//		ls_userobject = ids_store.object.cTabMain[1]
//		ls_rutaMain = ids_store.object.cRutaIcoMain[1] 
//		ls_titulo ='Report ' + ids_store.object.cTituloMain[1]
//	  
//		gstruc_param.as_rutaicosecu=ids_store.object.cRutaIcoSecu[1]
//		gstruc_param.as_tituloSecu='Reporte-' //ids_store.object.cTituloSecu[1]
//		gstruc_param.as_dw=ids_store.object.CTabSecuDw[1]  //'d_sysmenu'	
//		gstruc_param.as_dw2=ids_store.object.CTabSecuDw2[1]
//		gstruc_param.as_dw3=ids_store.object.CTabSecuDw3[1]
//		gstruc_param.as_tipomantodw=ids_store.object.CTipomantoDw[1]
////		if ids_store.object.CTipomantoDw[1] = '2' then
//		    gstruc_param.as_tabsecu=ids_store.object.cTabSecuReport[1]
////		else
////			gstruc_param.as_tabsecu=ids_store.object.cTabSecuManto[1]
////		end if
//		gstruc_param.as_dwReport = ids_store.object.cTabSecuReportDw[1]
//		gstruc_param.as_tiptab='R'
//		gstruc_param.as_opc='1' //nuevo
//		  gstruc_param.ll_menu = 	il_menu 
////		gstruc_param.ado_powerdock=uo_PowerDock
//		
//		iou_powerdock.of_opendocument( iuo_userObject[ii_tabindex],gstruc_param,ls_titulo ,ls_rutaMain,ls_userobject)
//		iou_powerdock.of_ActivateDocument(iuo_userObject[ii_tabindex])	
//	CASE 'NUEVO'
//		ii_tabindex++
//		ids_store   = create datastore
//		gnv_menu  = create nvo_menu	
//		gnv_menu.of_getUserObject(ids_store,il_menu)
////		messagebox('',string(il_menu))
//		ls_userobject = ids_store.object.cTabMain[1]
//		ls_rutaMain = ids_store.object.cRutaIcoMain[1] 
//		ls_titulo ='Manto ' + ids_store.object.cTituloMain[1]
//	  
//		gstruc_param.as_rutaicosecu=ids_store.object.cRutaIcoSecu[1]
//		gstruc_param.as_tituloSecu='Nuevo ' //ids_store.object.cTituloSecu[1]
//		gstruc_param.as_dw=ids_store.object.CTabSecuDw[1]  //'d_sysmenu'	
//		gstruc_param.as_dw2=ids_store.object.CTabSecuDw2[1]
//		gstruc_param.as_dw3=ids_store.object.CTabSecuDw3[1]
//		gstruc_param.as_tipomantodw=ids_store.object.CTipomantoDw[1]
//		if ids_store.object.CTipomantoDw[1] = '2' then
//		    gstruc_param.as_tabsecu=ids_store.object.cTabSecuManto2[1]
//		else
//			gstruc_param.as_tabsecu=ids_store.object.cTabSecuManto[1]
//		end if
//		gstruc_param.ll_menu = 	il_menu 
//		gstruc_param.as_tiptab='M'
//		gstruc_param.as_opc='1' //nuevo
////		gstruc_param.ado_powerdock=uo_PowerDock
//		
//		iou_powerdock.of_opendocument( iuo_userObject[ii_tabindex],gstruc_param,ls_titulo ,ls_rutaMain,ls_userobject)
//		iou_powerdock.of_ActivateDocument(iuo_userObject[ii_tabindex])
//
//
//
//
//







//		dw_2.Print()
//	CASE 'PREVIEW'
//		ib_preview = NOT ib_preview
//		IF ib_preview THEN
//			dw_2.Modify('Datawindow.Print.Preview=yes')
//		ELSE
//			dw_2.Modify('Datawindow.Print.Preview=no')
//		END IF
//	CASE 'CUT'
//		dw_2.Cut()
//	CASE 'COPY'
//		dw_2.Copy()
//	CASE 'PASTE'
//		dw_2.Paste()
//
//	CASE 'PRIOR ROW'
//		dw_2.SelectRow(0,FALSE)
//		dw_2.SetRow(dw_2.GetRow() - 1)
//		dw_2.SelectRow(dw_2.GetRow(), TRUE)
//		dw_2.ScrollToRow(dw_2.GetRow())
//	CASE 'FIRST ROW'
//		dw_2.SelectRow(0,FALSE)
//		dw_2.SetRow(1)
//		dw_2.SelectRow(1, TRUE)
//		dw_2.ScrollToRow(1)
//	CASE 'NEXT ROW'
//		dw_2.SelectRow(0,FALSE)
//		dw_2.SetRow(dw_2.GetRow() + 1)
//		dw_2.SelectRow(dw_2.GetRow(), TRUE)
//		dw_2.ScrollToRow(dw_2.GetRow())
//	CASE 'LAST ROW'
//		dw_2.SelectRow(0,FALSE)
//		dw_2.SetRow(dw_2.RowCount())
//		dw_2.SelectRow(dw_2.RowCount(), TRUE)
//		dw_2.ScrollToRow(dw_2.RowCount())
END CHOOSE
end event

type uo_gb_listado from u_cst_groupbox within u_cst_tab_asignaciones
integer x = 2341
integer y = 236
integer width = 1563
integer height = 2056
integer taborder = 50
end type

on uo_gb_listado.destroy
call u_cst_groupbox::destroy
end on

type uo_gb_asig from u_cst_groupbox within u_cst_tab_asignaciones
integer x = 18
integer y = 364
integer width = 1774
integer height = 1924
integer taborder = 60
end type

on uo_gb_asig.destroy
call u_cst_groupbox::destroy
end on

type uo_gb_borde from u_cst_groupbox within u_cst_tab_asignaciones
integer x = 5
integer y = 108
integer width = 4736
integer height = 2208
integer taborder = 60
boolean border = true
long #fontsize = 14
long #fontcolor = 1
boolean #bold = true
string #text = "Asignacion de ToolBar / Botoneras"
end type

on uo_gb_borde.destroy
call u_cst_groupbox::destroy
end on

